package com.xiaochun.jiankangapp.fragment

import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import com.xiaochun.jiankangapp.R
import com.xiaochun.jiankangapp.activity.InputInfoActivity
import com.xiaochun.jiankangapp.viewmodel.InputInfoViewModel

open class InputInfoBaseFragment : CoreFragment() {

    protected val inputViewModel: InputInfoViewModel by activityViewModels()

    protected fun <T : Fragment> replaceNext(clazz: Class<T>) {
        val a = activity as InputInfoActivity
        a.supportFragmentManager.beginTransaction().replace(R.id.realcontent, clazz.newInstance())
            .commitAllowingStateLoss()
    }
}